package com.hzspace.controller;

import com.hzspace.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: LiuHao
 * @Descirption:
 * @Date: 2020/2/25_19:59
 */
@RestController
public class HelloController {

    @Autowired
    HelloService helloService;

    @GetMapping("/hello")
    public Object hello() {
        return helloService.sayHello();
    }

    @GetMapping("/data")
    public Object data() {
        //fastJson需要配置MessageConverter才能正常返回List
        List list = new ArrayList();
        for (int i = 0; i < 10; i++) {
            list.add("Hello World 哈哈 " + i);
        }
        return list;
    }
}
